﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Windows.Forms;
using TestSystem.Model;
using TestSystem.Ui.Helpers;

namespace TestSystem.Ui
{
    static class Program
    {
        private static ModelFacade model;
        public static ModelFacade Model
        {
            get { return model; }
        }

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.ThreadException += Application_ThreadException;
            model = new ModelFacade();
            Application.Run(new MainForm());
        }

        private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
        {
            MessagingHelper.ShowError("Sorry, unknown error occured.");
        }
    }
}
